package com.tuzhi.base.web.interceptor;

import org.apache.commons.io.Charsets;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;

public class RSAConfig {
    public static final String PUBLIC_KEY;

    static {
        InputStream inputStream = RSAConfig.class.getResourceAsStream("/interceptor/public.pem");
        try {
            PUBLIC_KEY = IOUtils.toString(inputStream, Charsets.toCharset("utf-8"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static String getPublicKey() {
        return PUBLIC_KEY;
    }

    public static void main(String[] args) {
        System.out.println(getPublicKey());
    }
}
